package com.atmc.controller;

import com.atmc.entity.DetailUser;
import com.atmc.entity.DetailsData;
import com.atmc.entity.GoodsOrder;
import com.atmc.entity.ResponseResult;
import com.atmc.service.DetailsOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @BelongsProject: SpringCloud1216
 * @BelongsPackage: com.atmc.controller
 * @Author: chuyings
 * @CreateTime: 2022-11-17  18:20
 * @Version: 1.0
 */
@RestController
@CrossOrigin
public class DetailsOrderController {
    @Autowired
    DetailsOrderService detailsOrderService;
//    渲染当前用户的全部订单信息
    @PostMapping("/goodsOrderAll")
    public List<DetailsData> goodsOrderAll(@RequestBody DetailUser detailUser){
        return detailsOrderService.goodsOrderAll(detailUser.getUserName());
    }
//    渲染当前用户的全部领养宠物信息
    @PostMapping("/myAdoption")
    public ResponseResult myAdoption(@RequestBody DetailUser detailUser){

        return detailsOrderService.myAdoption(detailUser.getUserName());
    }
}
